<template>
    <div>
        <h3>Gege爱玩{{ hero }}</h3>
        <button @click="changeHero">修改爱玩的英雄</button>
    </div>
</template>

<script>
import PubSub from "pubsub-js";
export default {
    name: "Didi",
    data() {
        return {
            hero: "卡莎",
        };
    },
    methods: {
        changeHero() {
            this.hero = "莎弥拉";
            PubSub.publish("changeHero", this.hero)
        },
    },
};
</script>

<style></style>
